package com.feonix.common.annotation;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;


public class AnnotationBean<T extends Annotation> {
	private String name;
	private T annotation;
	private Class<?> fieldType;
	private Field field;

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public T getAnnotation() {
		return this.annotation;
	}

	public void setAnnotation(T annotation) {
		this.annotation = annotation;
	}

	public Class<?> getFieldType() {
		return this.fieldType;
	}

	public void setFieldType(Class<?> fieldType) {
		this.fieldType = fieldType;
	}

	public Field getField() {
		return this.field;
	}

	public void setField(Field field) {
		this.field = field;
	}

	public boolean equals(Object annotation) {
		if (annotation instanceof AnnotationBean) {
			AnnotationBean<?> annotationBean = (AnnotationBean<?>) annotation;

			return (annotationBean.getName().equals(this.name));
		}

		return super.equals(annotation);
	}
}
